var t = require("../../../@babel/runtime/helpers/toConsumableArray"), a = getApp();

Page({
    data: {
        share_desc: "",
        order_id: "",
        goodList: [],
        totalNum: 0,
        totalPrice: "",
        buttons: [],
        shareTit: "",
        shareImg: ""
    },
    onLoad: function(t) {
        this.setData({
            order_id: t.order_id
        }), this.getOrderDetail(), this.getShareInfo();
    },
    onReady: function() {},
    getOrderDetail: function() {
        var t = this, e = a.getNetAddresss("order.another-pay-detail");
        e += "&order_id=" + this.data.order_id, a._getNetWork({
            url: e,
            success: function(e) {
                1 == e.data.result ? (t.formatGoods(e.data.data), wx.setNavigationBarTitle({
                    title: e.data.plugin_name || "上级代付"
                })) : (a.tips(e.data.msg), console.log("错误", e.data.msg));
            },
            fail: function(t) {}
        });
    },
    formatGoods: function(a) {
        var e = 0, o = "", r = [];
        a.forEach(function(a) {
            return r.push.apply(r, t(a.has_many_order_goods)), o += a.price, e += a.goods_total;
        }), this.setData({
            totalNum: e,
            totalPrice: o,
            goodList: r
        });
    },
    getShareInfo: function() {
        var t = this, e = a.getNetAddresss("plugin.parent-payment.frontend.modules.payment.controllers.share.index");
        e += "&order_ids=" + this.data.order_id, a._getNetWork({
            url: e,
            success: function(e) {
                console.log("ressss::::", e), 1 == e.data.result ? t.setData({
                    shareTit: e.data.data.title,
                    shareImg: e.data.data.image
                }) : (a.tips(e.data.msg), console.log("错误", e.data.msg));
            },
            fail: function(t) {}
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        var t = wx.getStorageSync("yz_uid"), a = "";
        return t && (a = t), console.log("/packageH/superior_payment/superiorPaymentPay/superiorPaymentPay?order_id=" + this.data.order_id + "&mid=" + a + "&pid=" + a), 
        {
            title: this.data.shareTit,
            imageUrl: this.data.shareImg,
            path: "/packageH/superior_payment/superiorPaymentPay/superiorPaymentPay?order_id=" + this.data.order_id + "&mid=" + a + "&pid=" + a
        };
    }
});